var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    host: app.globalData.remoteDomain,
    myhost: app.globalData.remoteDomainMy,
    datas:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var that = this;
    //去除tabbar购物车数量
    let storageDatas = wx.getStorageSync(app.globalData.openid);
    if (storageDatas.book.length < 1 && storageDatas.music.length < 1 && storageDatas.movie.length < 1){
      wx.removeTabBarBadge({
        index: 2
      })
    }


    wx.request({
      url: app.globalData.remoteDomainApi+'getuserinfo.php', 
      data: {
        openid:app.globalData.openid,
        y: ''
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        console.log(res.data)
        that.setData({
          datas: res.data
        })
      }
    })

  },

/**
 * 完善资料
 */
my:function(e){
  let tap = e.currentTarget.dataset.tap;
  wx.navigateTo({
    url: '../' + tap + '/' + tap,
  })
}
 
})